﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TagRequester
{
    namespace ViewModel
    {
        public class Param
        {
            /// <summary>
            /// 连接符
            /// </summary>
            public string separator { get; set; }

            /// <summary>
            /// 参数列表
            /// </summary>
            public Dictionary<string,string> parameters { get; set; }

            public override string ToString()
            {
                return string.Join(this.separator, parameters.ToList());
            }
        }

        public class Cookie:Param
        {
            public Cookie()
            {
                this.separator = ";";
            }
        }
        public class Headers:Param
        {
            public Headers()
            {
                this.separator = "\r\n";
            }
        }
        public class FormData:Param
        {
            public FormData ()
            {
                this.separator = "&";
            }
        }
        public class QueryStringParameters : Param
        {
            public QueryStringParameters()
            {
                this.separator = "&";
            }
        }



        public class RequestViewModel
        {
            public string Url { get; set; }

            public bool isPost { get; set; }
            public string Cookie { get; set; }

            public string Headers { get; set; }

            public string FormData { get; set; }
        }
    }
}
